/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aaron.platform.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author mac
 */
@Entity
@Table(name = "fgys_physical_site")
@SequenceGenerator(name="FGYS_PHYSICALSITE_GENERATOR", sequenceName="FGYS_PHYSICALSITE_GENERATOR", allocationSize = 1)
@NamedQueries({
    @NamedQuery(name = "FgysPhysicalSite.findAll", query = "SELECT f FROM FgysPhysicalSite f")})
public class FgysPhysicalSite implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator="FGYS_PHYSICALSITE_GENERATOR")
    @Column(name = "site_id")
    private Integer siteId;

    /** 站点名称 */
    @Column(name = "site_name")
    private String siteName;

    /** 站点地址 */
    @Column(name = "site_address")
    private String siteAddress;

    /** 经度 */
    @Column(name = "site_lot")
    private float siteLot;

    /** 纬度 */
    @Column(name = "site_lat")
    private float siteLat;

    /** 物业点类型:1-酒店;2-商务楼;3-餐饮;4-小区;5-综合市场 ... */
    @Column(name = "phy_type")
    private int phyType;

    /** 站点需求(二进制表示):001-GSM;010-TD;100-WLAN
    *   如：011-需要做GSM和TD覆盖，没有WLAN覆盖需求
    */
    @Column(name = "site_require")
    private int siteRequire;

    /** 是否难点站 */
    @Column(name = "is_difficult")
    private boolean difficult;

    /** 是否敏感站 */
    @Column(name = "is_sensitive")
    private boolean sensitive;

    /** 备注信息 */
    @Column(name = "remark")
    private String remark;

    /** 站点所属于的区域 */
    @JoinColumn(name = "domain_id", referencedColumnName = "domain_id")
    @ManyToOne(optional = false, fetch = FetchType.EAGER)
    private ItscDomainInfo domainInfo;

    /** 站点下的所有逻辑站点 */
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "phySiteInfo", fetch = FetchType.LAZY)
    private List<FgysLogicalSite> fgysLogicalSiteList;

    public FgysPhysicalSite() {
    }

    public FgysPhysicalSite(Integer siteId) {
        this.siteId = siteId;
    }

    public Integer getSiteId() {
        return siteId;
    }

    public void setSiteId(Integer siteId) {
        this.siteId = siteId;
    }

    public String getSiteName() {
        return siteName;
    }

    public void setSiteName(String siteName) {
        this.siteName = siteName;
    }

    public String getSiteAddress() {
        return siteAddress;
    }

    public void setSiteAddress(String siteAddress) {
        this.siteAddress = siteAddress;
    }

    public float getSiteLot() {
        return siteLot;
    }

    public void setSiteLot(float siteLot) {
        this.siteLot = siteLot;
    }

    public float getSiteLat() {
        return siteLat;
    }

    public void setSiteLat(float siteLat) {
        this.siteLat = siteLat;
    }

    public boolean isDifficult() {
        return difficult;
    }

    public void setDifficult(boolean difficult) {
        this.difficult = difficult;
    }

    public boolean isSensitive() {
        return sensitive;
    }

    public void setSensitive(boolean sensitive) {
        this.sensitive = sensitive;
    }

    public int getPhyType() {
        return phyType;
    }

    public void setPhyType(int phyType) {
        this.phyType = phyType;
    }

    public int getSiteRequire() {
        return siteRequire;
    }

    public void setSiteRequire(int siteRequire) {
        this.siteRequire = siteRequire;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public ItscDomainInfo getDomainInfo() {
        return domainInfo;
    }

    public void setDomainInfo(ItscDomainInfo domainInfo) {
        this.domainInfo = domainInfo;
    }

    public List<FgysLogicalSite> getFgysLogicalSiteList() {
        return fgysLogicalSiteList;
    }

    public void setFgysLogicalSiteList(List<FgysLogicalSite> fgysLogicalSiteList) {
        this.fgysLogicalSiteList = fgysLogicalSiteList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (siteId != null ? siteId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FgysPhysicalSite)) {
            return false;
        }
        FgysPhysicalSite other = (FgysPhysicalSite) object;
        if ((this.siteId == null && other.siteId != null) || (this.siteId != null && !this.siteId.equals(other.siteId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.aaron.platform.entity.FgysPhysicalSite[siteId=" + siteId + "]";
    }
}
